import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex);
export default new Vuex.Store({
	state :{
		topListIds : [],
		nextId : '',
		usermsg:[]
	},
	mutations:{
		INIT_TOPLISTIDS(state,payload){
			state.topListIds = payload;
		
		},
		INIT_USERMSG(state,userres){
			state.usermsg = userres;
		},
		NEXT_ID(state ,payload){
			for(var i=0; i<state.topListIds.length;i++){
				if(state.topListIds[i].id == payload){
					state.nextId = state.topListIds[i+1].id;
				}
			}
		}	
		
	}
})